package com.baozun.houji.me.viewmodel

import androidx.lifecycle.MutableLiveData
import com.alibaba.android.arouter.launcher.ARouter
import com.baozhun.mall.common.arouter.RoutePath
import com.baozhun.mall.common.model.HomePageBean
import com.baozhun.mall.common.model.bean.UserInfo
import com.baozhun.mall.common.network.mCommonApiService
import com.baozhun.mall.common.util.CacheUtil
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.ext.request

/**
 *  @Title：MeViewModel
 * @Description：
 * @Author：xuefeng.zhu
 * @Since：2022/11/4
 * @Version：1.0.0
 */
class MeViewModel : BaseViewModel() {

    var mUserInfo = MutableLiveData<UserInfo>()
    /**
     * 获取用户信息数据
     */
    fun getUserInfo() {
        if (!CacheUtil.isLogin()) return
        request({ mCommonApiService.getUserInfo() }, {
            mUserInfo.value = it
        }, isShowDialog = false)
    }
}